package com.autumn.zero.authorization.entitys.users.querys;

import javax.persistence.Table;

import com.autumn.mybatis.mapper.annotation.ViewTable;
import com.autumn.zero.authorization.entitys.users.UserRole;

/**
 * 用户角色查询
 * 
 * @author 杨昌国 2018-12-10 15:42:56
 */
@Table
@ViewTable(UserRoleQuery.QUERY_COMMAND_TEXT)
public class UserRoleQuery extends UserRole {

	/**
	 * 
	 */
	private static final long serialVersionUID = 993727036103814273L;

	/**
	 * 
	 */
	static final String QUERY_COMMAND_TEXT = "SELECT a.id,a.user_id,b.user_name,a.role_id,c.name AS role_name"
			+ " FROM sys_user_role AS a " + " INNER JOIN sys_user AS b ON a.user_id = b.id"
			+ " INNER JOIN sys_role AS c ON a.role_id = c.id";
	
	/**
	 * 字段 userName
	 */
	public static final String FILED_USER_NAME = "userName";
	
	/**
	 * 字段 roleName
	 */
	public static final String FILED_ROLE_NAME = "roleName";

	/**
	 * 用户名称
	 */
	private String userName;
	/**
	 * 角色名称
	 */
	private String roleName;

	/**
	 * 获取用户名称
	 * 
	 * @return
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * 设置用户名称
	 * 
	 * @param userName 用户名称
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 * 获取角色名称
	 * 
	 * @return
	 */
	public String getRoleName() {
		return roleName;
	}

	/**
	 * 设置角色名称
	 * 
	 * @param roleName 角色名称
	 */
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

}
